package com.kaifamiao.month05.day10;

import java.io.BufferedWriter;
import java.io.OutputStream;
import java.net.Socket;
import java.util.Scanner;

public class C {

    public static void main(String[] args) throws Exception{
        Scanner sc = new Scanner(System.in);

        while(true) {
            Socket socket = new Socket("localhost", 8888);
            socket.setKeepAlive(true);
            String str = sc.nextLine();
            OutputStream out = socket.getOutputStream();
////            BufferedOutputStream o = new BufferedOutputStream(out);
            out.write(str.getBytes());
            socket.shutdownOutput();
//            out.flush();
        }

    }
}
